#!/bin/bash
set -x
Server_IP=127.0.0.1
PORT_PREFIX=8
NODE_ID=15
./tc &

# 启动server
index=0
coreId=120
while [ ${index} -lt 8 ]
do
	numactl -C ${coreId} -m ${NODE_ID} iperf3 -s -B ${Server_IP} -p ${PORT_PREFIX}0${index}  &
	let index=${index}+1
	let coreId=${coreId}+1
done
# 等待server启动
sleep 3
counter=0
while [ 1 -eq 1 ]
do
        echo "fio $(date) counter=${counter}"
	let index=0
	coreId=120
 	while [ ${index} -lt 7 ]
	do
		numactl -C ${coreId} -m ${NODE_ID} iperf3 -c ${Server_IP} -p ${PORT_PREFIX}0${index} &
		let index=${index}+1
		let coreId=${coreId}+1
	done
	numactl -C ${coreId} -m ${NODE_ID} iperf3 -c ${Server_IP} -p ${PORT_PREFIX}0${index} 
        let counter=${counter}+1
done
